#include "StudentImpl_t.h"
#include "Student_t.h"
#include <iostream>
#include <sstream>

Student_t::Student_t(StudentImpl_t* impl)
	: m_id(0)
	, m_name("")
	, m_impl(impl)
{
}

Student_t::~Student_t()
{
	delete m_impl;
}

void Student_t::update(const std::string& message) const
{
	std::ostringstream _student;
	_student << "Student " << name() << " (id " << id() << ") from faculty "<< m_impl->facultyName();
	std::string studentInfo=_student.str();

	if(message=="Price Raised")
		std::cout << studentInfo << " is complaining about the high price." << std::endl;

	if(message=="Lecture Canceled")
		std::cout << studentInfo << " will not go to class tomorrow." << std::endl;
}
